export default {
    namespaced: true,
    state: {
        isShow: false,
        // 提示信息
        toastMsg: "默认提示内容....",
        // 提示图标(success成功，danger失败，warning警告)
        toasType: "success"
    },
    mutations: {
        changeIsShowToast(state, payload) {
            state.isShow = payload.isshow
            if (payload.isshow) {
                state.toastMsg = payload.msg
                state.toasType = payload.type
            }

        }
    },
    actions: {
        asyncIsShowToast({ commit }, payload) {
            commit("changeIsShowToast", payload)

            setTimeout(() => {
                commit("changeIsShowToast", {
                    isshow: false
                })
            }, 2000);
        }
    }
}